package com.example.demo.unit;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author luowenjie
 * @since 2021/9/14 20:26
 */
public class Date1Test {

    public static void main(String[] args) {
        long milliSecond = 1570650412089L;
        Date date = new Date();
        date.setTime(milliSecond);
        System.out.println(new SimpleDateFormat().format(date));
        
        System.out.println(System.currentTimeMillis());
        Timestamp createTime = new Timestamp(new Date().getTime());
        long l = 1631681895L;
        //将订阅时间设为创建时间
        Timestamp    createTime1 = new Timestamp(l*1000);

        Timestamp    createTime2 = new Timestamp(new Date().getTime());

        System.out.println(createTime1);
        System.out.println(createTime2);
        System.out.println(l*1000);
        System.out.println(new Date().getTime());

    }

}

